package com.irs.irsforum.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.irs.irsforum.entity.Behavior;
import com.irs.irsforum.entity.IndexPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yihuili
 * @since 2020-01-18
 */
@Mapper
public interface BehaviorMapper extends BaseMapper<Behavior> {

    Integer setBehavior(@Param("behavior") Behavior behavior);

    Behavior getBehavior(@Param("postId") Long postId, @Param("userId") Long userId);

    Integer updateBehavior(@Param("behavior") Behavior behavior);

    List<IndexPage> getRecommendProSubList(@Param("behavior") Behavior behavior);

    List<Long> getRecommendUser(@Param("subjectId") Long subjectId, @Param("userId") Long userId);

    List<Long> getUserByCollaborativeFiltering(IndexPage indexPage);

    List<IndexPage> getMaxPostNum(IndexPage indexPage);
}
